#ifndef __FILERWSATTRIBUTE_H_
#define __FILERWSATTRIBUTE_H_
#include <linknode.h>

#define LockList(lock)   do{EnterCriticalSection(&lock);}while(0)
#define UnlockList(lock) do{LeaveCriticalSection(&lock);}while(0)

class FileAttr : public DLinkNode 
{
public:
    wchar_t FileName[_MAX_PATH];
    FileShareMode curShareMode;
    IBasicFile *pOwner;
    Int32 objectCount;
};

void InitialFileAttriList();

ECode GetFileAttr(wchar_t *pFileName,
                  IBasicFile* pBasicFile,
                  FileAttr **pFileAttr);

void RemoveFromFileAttriList(wchar_t *FileName);

void DestroyFileAttriList();

ECode SetFileShareMode(IBasicFile * pBasicFile,
                       FileAttr * pFileAttr, 
                       FileShareMode mode);

#endif
